home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / HyperCuber Source / HyperCuber 2.0 Source.sit / HyperCuber 2.0 Source / CControlsWindow.cp < prev    next >
Text File  |  1994-05-01  |  3KB  |  121 lines

  1. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. //| CControlsWindow.cp
  3. //|
  4. //| This file contains the implementation of a controls window.
  5. //|___________________________________________________________________________
  6.  
  7. #include "CControlsWindow.h"
  8. #include "CHyperCuberPrefs.h"
  9.  
  10.  
  11.  
  12. //=============================== Globals ===============================\\
  13.  
  14. extern CHyperCuberPrefs *gPrefs;
  15.  
  16.  
  17.  
  18. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  19. //| CControlsWindow::IControlsWindow
  20. //|
  21. //| Purpose: Initialize the window
  22. //|
  23. //| Parameters: passed to superclass
  24. //|______________________________________________________________
  25.  
  26. void CControlsWindow::IControlsWindow(short WINDid, Boolean aFloating,
  27.                         CDesktop *anEnclosure, CDirector *aSupervisor, short dim)
  28. {
  29.  
  30.     IEnhancedWindow(WINDid, aFloating, anEnclosure, aSupervisor);
  31.     
  32.     dimension = dim;
  33.     title_bar_height = 10;
  34.  
  35. }    //==== CControlsWindow::IControlsWindow() ====\\
  36.  
  37.  
  38.  
  39. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. //| CControlsWindow::Move
  41. //|
  42. //| Purpose: Move the window
  43. //|
  44. //| Parameters: passed to superclass
  45. //|______________________________________________________________
  46.  
  47. void CControlsWindow::Move(short h, short v)
  48. {
  49.     
  50.     inherited::Move(h, v);
  51.     
  52.     GetRect(&gPrefs->prefs.controls_window_position[dimension]);    //  Save new window position
  53.  
  54. }    //==== CControlsWindow::Move() ====\\
  55.  
  56.  
  57.  
  58. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. //| CControlsWindow::Drag
  60. //|
  61. //| Purpose: Drag the window
  62. //|
  63. //| Parameters: passed to superclass
  64. //|______________________________________________________________
  65.  
  66. void CControlsWindow::Drag(EventRecord *macEvent)
  67. {
  68.     
  69.     inherited::Drag(macEvent);
  70.  
  71.     GetRect(&gPrefs->prefs.controls_window_position[dimension]);    //  Save new window position
  72.     
  73. }    //==== CControlsWindow::Move() ====\\
  74.  
  75.  
  76.  
  77. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. //| CControlsWindow::HideFloat
  79. //|
  80. //| Purpose: Hide the floating window
  81. //|
  82. //| Parameters: passed to superclass
  83. //|______________________________________________________________
  84.  
  85. void CControlsWindow::HideFloat(void)
  86. {
  87.  
  88. //    GetRect(&gPrefs->prefs.controls_window_position[dimension]);//  Save new window position
  89. //    gPrefs->prefs.controls_window_visible[dimension] = FALSE;    //  Window is no longer visible
  90.     
  91.     inherited::HideFloat();                                        //  Hide the window    
  92.  
  93. }    //==== CControlsWindow::HideFloat() ====\\
  94.  
  95.  
  96.  
  97. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. //| CControlsWindow::ShowFloat
  99. //|
  100. //| Purpose: Show the floating window
  101. //|
  102. //| Parameters: passed to superclass
  103. //|______________________________________________________________
  104.  
  105. void CControlsWindow::ShowFloat(void)
  106. {
  107.  
  108. //    Rect window_rect =
  109. //            gPrefs->prefs.controls_window_position[dimension];    //  Get correct position
  110.  
  111. //    hiding.h = window_rect.left;                                //  Show window at correct place
  112. //    hiding.v = window_rect.top;
  113.  
  114.     inherited::ShowFloat();                                        //  Show the window
  115.  
  116. //    Place(&window_rect);                                        //  Move to correct position
  117.  
  118. //    gPrefs->prefs.controls_window_visible[dimension] = TRUE;    //  Window is now visible
  119.  
  120. }    //==== CControlsWindow::ShowFloat() ====\\
  121.